import Vue from 'vue'
import VueRouter from "vue-router"
import NotFound from '../pages/404/404.vue'

import Login from '../pages/User/Login/Login.vue'
import Regist from '../pages/User/Regist/Regist.vue'
import Home from '../pages/Home/Home.vue'
import mainHome from '../pages/User/Main/MainHome.vue'
import ticketFind from '../pages/User/Ticket/TicketFind.vue'
import ticketChange from '../pages/User/Ticket/TicketChange.vue'
import trainNumber from '../pages/User/Train/TrainStationNumber.vue'
import stationScreen from '../pages/User/Train/TrainStationScreen.vue'
import Customer from '../pages/User/Customer/Customer.vue'
import Account from '../pages/User/Account/Account.vue'
import orderForm from '../pages/User/OrderForm/OrderForm.vue'
import ticketForm from '../pages/User/OrderForm/TicketForm.vue'


import AdminHome from '../pages/Home/AdminHome.vue'
import AdminLogin from '../pages/Admin/ALogin/ALogin.vue'

import AdminInfo from '../pages/Admin/AdminInfo/AdminInfo.vue'
import Station from '../pages/Admin/Raliway/Station.vue'
import Authority from '../pages/Admin/Raliway/Authority.vue'
import Price from '../pages/Admin/Train/Price.vue'
import Train from '../pages/Admin/Train/Train.vue'
import ATrainNumber from '../pages/Admin/TrainNumber/TrainNumber.vue'

Price


Vue.use(VueRouter)
const router = new VueRouter({
    routes: [
        {
            path: "/",
            name: "Home",
            component: Home,
            children: [
                {
                    path: "/mainHome",
                    name: "mainHome",
                    component: mainHome
                },
                {
                    path: "/ticketFind",
                    name: "ticketFind",
                    component: ticketFind
                },
                {
                    path: "/ticketChange",
                    name: "ticketChange",
                    component: ticketChange
                },
                {
                    path: "/trainNumber",
                    name: "trainNumber",
                    component: trainNumber
                },
                {
                    path: "/stationScreen",
                    name: "stationScreen",
                    component: stationScreen
                },
                {
                    path: "/customer",
                    name: "Customer",
                    component: Customer
                },
                {
                    path: "/account",
                    name: "account",
                    component: Account
                },
                {
                    path: "/orderForm",
                    name: "orderForm",
                    component: orderForm
                },
                {
                    path: "/ticketForm",
                    name: "ticketForm",
                    component: ticketForm
                },
                // {
                //     path: "/orderStay",
                //     name: "orderStay",
                //     component: orderStay
                // }
            ]
        },

        {
            path: "/login",
            name: "login",
            component: Login
        },

        {
            path: "/regist",
            name: "regist",
            component: Regist
        },
        {
            path: "/adminHome",
            name: "adminHome",
            component: AdminHome,
            children: [
                {
                    path: "/admin/trainNumber",
                    name: "trainNumber",
                    component: ATrainNumber,
                },
                {
                    path: "/admin/adminInfo",
                    name: "adminInfo",
                    component: AdminInfo,
                } ,  
                {
                    path: "/admin/station",
                    name: "station",
                    component: Station,
                } ,  
                {
                    path: "/admin/authority",
                    name: "authority",
                    component: Authority,
                } ,   
                {
                    path: "/admin/price",
                    name: "price",
                    component: Price,
                } ,    
                {
                    path: "/admin/train",
                    name: "train",
                    component: Train,
                } ,   
            ]
        },
        {
            path: "/adminlogin",
            name: "adminlogin",
            component: AdminLogin
        },
        {
            path: '/:pathMatch(.*)*',
            name: 'NotFound',
            component: NotFound
        },

    ]
});
// router.beforeEach((to, from, next) => {
//     console.log(to);
//     console.log(from);
//     console.log(next);
//   })



export default router